/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package googletalkxmpp;

import java.io.File;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

/**
 *
 * @author Dmitriy
 */
public class LoadConfig {
    
    private Config config = null;
    
    public LoadConfig(){
        try{

            File file = new File("config.xml");
            JAXBContext jaxbContext = JAXBContext.newInstance(Config.class);
                  
            Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
            config = (Config) jaxbUnmarshaller.unmarshal(file);
                        
        }catch(JAXBException e){
            e.printStackTrace();
        }
    }
    
    public Config getConfig(){
        return config;
    }
}
